
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>8.1. 常见问题解答 · MobX 中文文档</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.2">
        
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-anchors/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="../best/pitfalls.html" />
    
    

    <style>
    @media only screen and (max-width: 640px) {
        .book-header .hidden-mobile {
            display: none;
        }
    }
    </style>
    <script>
        window["gitbook-plugin-github-buttons"] = {"buttons":[{"user":"SangKa","repo":"MobX-Docs-CN","type":"star","size":"small","count":true},{"user":"SangKa","repo":"MobX-Docs-CN","type":"fork","size":"small","count":true}]};
    </script>

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    1. MobX 介绍
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1.1" data-path="../intro/overview.html">
            
                <a href="../intro/overview.html">
            
                    
                    1.1. MobX 要点
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.2" data-path="../intro/concepts.html">
            
                <a href="../intro/concepts.html">
            
                    
                    1.2. 概念与原则
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../refguide/api.html">
            
                <a href="../refguide/api.html">
            
                    
                    2. API概览
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" >
            
                <span>
            
                    
                    3. observable 相关
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../refguide/observable.html">
            
                <a href="../refguide/observable.html">
            
                    
                    3.1. observable
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../refguide/observable-decorator.html">
            
                <a href="../refguide/observable-decorator.html">
            
                    
                    3.2. @observable
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="../refguide/object.html">
            
                <a href="../refguide/object.html">
            
                    
                    3.3. objects
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.4" data-path="../refguide/array.html">
            
                <a href="../refguide/array.html">
            
                    
                    3.4. arrays
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.5" data-path="../refguide/map.html">
            
                <a href="../refguide/map.html">
            
                    
                    3.5. maps
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.6" data-path="../refguide/boxed.html">
            
                <a href="../refguide/boxed.html">
            
                    
                    3.6. boxed values
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.7" data-path="../refguide/modifiers.html">
            
                <a href="../refguide/modifiers.html">
            
                    
                    3.7 decorators
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" >
            
                <span>
            
                    
                    4. 对 observables 作出响应
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../refguide/computed-decorator.html">
            
                <a href="../refguide/computed-decorator.html">
            
                    
                    4.1. (@)computed
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="../refguide/autorun.html">
            
                <a href="../refguide/autorun.html">
            
                    
                    4.2. autorun
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="../refguide/when.html">
            
                <a href="../refguide/when.html">
            
                    
                    4.3. when
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="../refguide/reaction.html">
            
                <a href="../refguide/reaction.html">
            
                    
                    4.4. reaction
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.5" data-path="../refguide/observer-component.html">
            
                <a href="../refguide/observer-component.html">
            
                    
                    4.5. (@)observer
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.6" data-path="../best/react.html">
            
                <a href="../best/react.html">
            
                    
                    4.6. 理解 MobX 对何作出响应
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" >
            
                <span>
            
                    
                    5. 改变 observables
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../refguide/action.html">
            
                <a href="../refguide/action.html">
            
                    
                    5.1. action
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="../best/actions.html">
            
                <a href="../best/actions.html">
            
                    
                    5.2. async actions & flows
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="../refguide/object-api.html">
            
                <a href="../refguide/object-api.html">
            
                    
                    5.3. Object api
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" >
            
                <span>
            
                    
                    6. 工具函数
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../refguide/tojson.html">
            
                <a href="../refguide/tojson.html">
            
                    
                    6.1. toJS
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../refguide/extend-observable.html">
            
                <a href="../refguide/extend-observable.html">
            
                    
                    6.2. extendObservable
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="../refguide/extending.html">
            
                <a href="../refguide/extending.html">
            
                    
                    6.3. createAtom
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.4" data-path="../refguide/observe.html">
            
                <a href="../refguide/observe.html">
            
                    
                    6.4. intercept & observe
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.5" >
            
                <a target="_blank" href="https://github.com/mobxjs/mobx-utils#frompromise">
            
                    
                    6.5. mobxUtils.fromPromise
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.6" >
            
                <a target="_blank" href="https://github.com/mobxjs/mobx-utils#fromresource">
            
                    
                    6.6. mobxUtils.fromResource
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.7" >
            
                <a target="_blank" href="https://github.com/mobxjs/mobx-utils#tostream">
            
                    
                    6.7. mobxUtils.toStream
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.8" >
            
                <a target="_blank" href="https://github.com/mobxjs/mobx-utils#fromstream">
            
                    
                    6.8. mobxUtils.fromStream
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.9" >
            
                <a target="_blank" href="https://github.com/mobxjs/mobx-utils#now">
            
                    
                    6.9. mobxUtils.now
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.10" data-path="../refguide/create-transformer.html">
            
                <a href="../refguide/create-transformer.html">
            
                    
                    6.10. mobxUtils.createTransformer
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.11" data-path="../refguide/expr.html">
            
                <a href="../refguide/expr.html">
            
                    
                    6.11. mobxUtils.expr
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.12" data-path="../refguide/api.html">
            
                <a href="../refguide/api.html">
            
                    
                    6.12. complete api overview
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" >
            
                <a target="_blank" href="https://github.com/mobxjs/awesome-mobx#examples">
            
                    
                    7. 博客、 视频及相关项目
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8" >
            
                <span>
            
                    
                    8. 贴士与技巧
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter active" data-level="1.8.1" data-path="faq.html">
            
                <a href="faq.html">
            
                    
                    8.1. 常见问题解答
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.2" data-path="../best/pitfalls.html">
            
                <a href="../best/pitfalls.html">
            
                    
                    8.2. 常见陷阱与最佳实践
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3" data-path="../best/decorators.html">
            
                <a href="../best/decorators.html">
            
                    
                    8.3. 如何(不)使用装饰器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.4" data-path="../best/trace.html">
            
                <a href="../best/trace.html">
            
                    
                    8.4. 使用 trace 进行调试
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.5" data-path="../best/store.html">
            
                <a href="../best/store.html">
            
                    
                    8.5. 定义数据存储
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.6" data-path="../best/react-performance.html">
            
                <a href="../best/react-performance.html">
            
                    
                    8.6. 优化 React 组件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.7" data-path="../best/devtools.html">
            
                <a href="../best/devtools.html">
            
                    
                    8.7. 开发工具
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.8" data-path="../refguide/spy.html">
            
                <a href="../refguide/spy.html">
            
                    
                    8.8. spy
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="../donating.html">
            
                <a href="../donating.html">
            
                    
                    9. 捐赠
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >8.1. 常见问题解答</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h2 id="&#x5E38;&#x89C1;&#x95EE;&#x9898;"><a name="&#x5E38;&#x89C1;&#x95EE;&#x9898;" class="plugin-anchor" href="#&#x5E38;&#x89C1;&#x95EE;&#x9898;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x5E38;&#x89C1;&#x95EE;&#x9898;</h2>
<h5 id="&#x652F;&#x6301;&#x54EA;&#x4E9B;&#x6D4F;&#x89C8;&#x5668;"><a name="&#x652F;&#x6301;&#x54EA;&#x4E9B;&#x6D4F;&#x89C8;&#x5668;" class="plugin-anchor" href="#&#x652F;&#x6301;&#x54EA;&#x4E9B;&#x6D4F;&#x89C8;&#x5668;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x652F;&#x6301;&#x54EA;&#x4E9B;&#x6D4F;&#x89C8;&#x5668;?</h5>
<p>MobX &#x53EA;&#x80FD;&#x5728; ES5 &#x73AF;&#x5883;&#x4E2D;&#x8FD0;&#x884C;&#x3002;&#x8FD9;&#x610F;&#x5473;&#x7740;&#x652F;&#x6301; Node.js&#x3001;Rhino&#x548C;&#x6240;&#x6709;&#x6D4F;&#x89C8;&#x5668;(&#x9664;&#x4E86; IE8&#x53CA;&#x4EE5;&#x4E0B;)&#x3002;&#x53C2;&#x89C1; <a href="http://caniuse.com/#feat=es5" target="_blank">caniuse.com</a></p>
<h5 id="mobx-&#x53EF;&#x4EE5;&#x548C;-rxjs-&#x4E00;&#x8D77;&#x4F7F;&#x7528;&#x5417;"><a name="mobx-&#x53EF;&#x4EE5;&#x548C;-rxjs-&#x4E00;&#x8D77;&#x4F7F;&#x7528;&#x5417;" class="plugin-anchor" href="#mobx-&#x53EF;&#x4EE5;&#x548C;-rxjs-&#x4E00;&#x8D77;&#x4F7F;&#x7528;&#x5417;"><i class="fa fa-link" aria-hidden="true"></i></a>MobX &#x53EF;&#x4EE5;&#x548C; RxJS &#x4E00;&#x8D77;&#x4F7F;&#x7528;&#x5417;?</h5>
<p>&#x53EF;&#x4EE5;&#xFF0C;MobX &#x53EF;&#x4EE5;&#x901A;&#x8FC7; <a href="https://github.com/mobxjs/mobx-utils#tostream" target="_blank">mobx-utils &#x4E2D;&#x7684; toStream &#x548C; fromStream</a> &#x4F7F;&#x7528; RxJS &#x548C;&#x5176;&#x5B83; TC 39 &#x517C;&#x5BB9;&#x7684; observable&#x3002;</p>
<h5 id="&#x4F55;&#x65F6;&#x4F7F;&#x7528;-rxjs-&#x66FF;&#x4EE3;-mobx"><a name="&#x4F55;&#x65F6;&#x4F7F;&#x7528;-rxjs-&#x66FF;&#x4EE3;-mobx" class="plugin-anchor" href="#&#x4F55;&#x65F6;&#x4F7F;&#x7528;-rxjs-&#x66FF;&#x4EE3;-mobx"><i class="fa fa-link" aria-hidden="true"></i></a>&#x4F55;&#x65F6;&#x4F7F;&#x7528; RxJS &#x66FF;&#x4EE3; MobX?</h5>
<p>&#x5BF9;&#x4E8E;&#x4EFB;&#x4F55;&#x6D89;&#x53CA;&#x660E;&#x786E;&#x4F7F;&#x7528;&#x65F6;&#x95F4;&#x7684;&#x6982;&#x5FF5;&#xFF0C;&#x6216;&#x8005;&#x5F53;&#x4F60;&#x9700;&#x8981;&#x63A8;&#x7406;&#x4E00;&#x4E2A; observable &#x5386;&#x53F2;&#x503C;/&#x4E8B;&#x4EF6;(&#x800C;&#x4E0D;&#x4EC5;&#x4EC5;&#x662F;&#x6700;&#x65B0;&#x7684;)&#x65F6;&#xFF0C;&#x5EFA;&#x8BAE;&#x4F7F;&#x7528; RxJS&#xFF0C;&#x56E0;&#x4E3A;&#x5B83;&#x63D0;&#x4F9B;&#x4E86;&#x66F4;&#x591A;&#x7684;&#x4F4E;&#x5C42;&#x7EA7;&#x7684;&#x539F;&#x59CB;&#x7C7B;&#x578B;&#x3002;
&#x5F53;&#x4F60;&#x60F3;&#x5BF9;<strong>&#x72B6;&#x6001;</strong>&#x4F5C;&#x51FA;&#x53CD;&#x5E94;&#xFF0C;&#x800C;&#x4E0D;&#x662F;<strong>&#x4E8B;&#x4EF6;</strong>&#x65F6;&#xFF0C;MobX &#x63D0;&#x4F9B;&#x4E86;&#x4E00;&#x79CD;&#x66F4;&#x5BB9;&#x6613;&#x800C;&#x4E14;&#x9AD8;&#x5C42;&#x7EA7;&#x5904;&#x7406;&#x65B9;&#x6CD5;&#x3002;
&#x5B9E;&#x9645;&#x4E0A;&#xFF0C;&#x7ED3;&#x5408; RxJS &#x548C; MobX &#x53EF;&#x80FD;&#x4F1A;&#x4EA7;&#x751F;&#x771F;&#x6B63;&#x5F3A;&#x5927;&#x7684;&#x67B6;&#x6784;&#x3002;
&#x4F8B;&#x5982;&#x4F7F;&#x7528; RxJS &#x6765;&#x5904;&#x7406;&#x548C;&#x8282;&#x6D41;&#x7528;&#x6237;&#x4E8B;&#x4EF6;&#xFF0C;&#x5E76;&#x4F5C;&#x4E3A;&#x66F4;&#x65B0;&#x72B6;&#x6001;&#x7684;&#x7ED3;&#x679C;&#x3002;
&#x5982;&#x679C;&#x72B6;&#x6001;&#x5DF2;&#x7ECF;&#x88AB; MobX &#x8F6C;&#x53D8;&#x6210; observable &#xFF0C;&#x5219;&#x5B83;&#x5C06;&#x76F8;&#x5E94;&#x5730;&#x5904;&#x7406;&#x66F4;&#x65B0; UI &#x548C;&#x5176;&#x5B83;&#x884D;&#x751F;&#x3002;</p>
<h5 id="&#x652F;&#x6301;-react-native-&#x5417;"><a name="&#x652F;&#x6301;-react-native-&#x5417;" class="plugin-anchor" href="#&#x652F;&#x6301;-react-native-&#x5417;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x652F;&#x6301; React Native &#x5417;?</h5>
<p>&#x5F53;&#x7136;&#xFF0C;<code>mobx</code> &#x548C; <code>mobx-react</code> &#x90FD;&#x53EF;&#x4EE5;&#x5728; React Native &#x4E2D;&#x4F7F;&#x7528;&#x3002;&#x540E;&#x8005;&#x901A;&#x8FC7;&#x5BFC;&#x5165; <code>&quot;mobx-react/native&quot;</code> &#x3002;
&#x5F00;&#x53D1;&#x8005;&#x5DE5;&#x5177;&#x8FD8;&#x4E0D;&#x652F;&#x6301; React Native &#x3002;&#x6CE8;&#x610F;&#xFF0C;&#x5982;&#x679C;&#x4F60;&#x6253;&#x7B97;&#x5C06;&#x72B6;&#x6001;&#x5B58;&#x50A8;&#x5728;&#x4F60;&#x5E0C;&#x671B;&#x80FD;&#x591F;&#x4E0E;&#x70ED;&#x91CD;&#x65B0;&#x52A0;&#x8F7D;&#x4E00;&#x8D77;&#x4F7F;&#x7528;&#x7684;&#x7EC4;&#x4EF6;&#x4E2D;&#xFF0C;&#x90A3;&#x4E48;&#x4E0D;&#x8981;&#x5728;&#x7EC4;&#x4EF6;&#x4E2D;&#x4F7F;&#x7528;&#x88C5;&#x9970;&#x5668;(&#x6CE8;&#x89E3;)&#xFF0C;&#x4F7F;&#x7528;&#x51FD;&#x6570;&#x66FF;&#x4EE3;(&#x4F8B;&#x5982;&#xFF0C;&#x7528; <code>action(fn)</code> &#x66FF;&#x4EE3; <code>@action</code>)&#x3002;</p>
<h5 id="mobx-&#x5982;&#x4F55;&#x517C;&#x5BB9;&#x5176;&#x5B83;&#x54CD;&#x5E94;&#x5F0F;&#x6846;&#x67B6;"><a name="mobx-&#x5982;&#x4F55;&#x517C;&#x5BB9;&#x5176;&#x5B83;&#x54CD;&#x5E94;&#x5F0F;&#x6846;&#x67B6;" class="plugin-anchor" href="#mobx-&#x5982;&#x4F55;&#x517C;&#x5BB9;&#x5176;&#x5B83;&#x54CD;&#x5E94;&#x5F0F;&#x6846;&#x67B6;"><i class="fa fa-link" aria-hidden="true"></i></a>MobX &#x5982;&#x4F55;&#x517C;&#x5BB9;&#x5176;&#x5B83;&#x54CD;&#x5E94;&#x5F0F;&#x6846;&#x67B6;?</h5>
<p>&#x53C2;&#x89C1;&#x6B64; <a href="https://github.com/mobxjs/mobx/issues/18" target="_blank">issue</a> &#x4EE5;&#x4E86;&#x89E3;&#x4E00;&#x4E9B;&#x6CE8;&#x610F;&#x4E8B;&#x9879;&#x3002;</p>
<h5 id="mobx-&#x662F;&#x6846;&#x67B6;&#x5417;"><a name="mobx-&#x662F;&#x6846;&#x67B6;&#x5417;" class="plugin-anchor" href="#mobx-&#x662F;&#x6846;&#x67B6;&#x5417;"><i class="fa fa-link" aria-hidden="true"></i></a>MobX &#x662F;&#x6846;&#x67B6;&#x5417;?</h5>
<p>MobX &#x4E0D;&#x662F;&#x4E00;&#x4E2A;&#x6846;&#x67B6;&#x3002;&#x5B83;&#x4E0D;&#x4F1A;&#x544A;&#x8BC9;&#x4F60;&#x5982;&#x4F55;&#x53BB;&#x7EC4;&#x7EC7;&#x4F60;&#x7684;&#x4EE3;&#x7801;&#xFF0C;&#x5728;&#x54EA;&#x5B58;&#x50A8;&#x72B6;&#x6001;&#x6216;&#x8005;&#x5982;&#x4F55;&#x5904;&#x7406;&#x4E8B;&#x4EF6;&#x3002;&#x7136;&#x800C;&#xFF0C;&#x5B83;&#x53EF;&#x80FD;&#x5C06;&#x4F60;&#x4ECE;&#x4EE5;&#x6027;&#x80FD;&#x7684;&#x540D;&#x4E49;&#x5BF9;&#x4F60;&#x7684;&#x4EE3;&#x7801;&#x63D0;&#x51FA;&#x5404;&#x79CD;&#x9650;&#x5236;&#x7684;&#x6846;&#x67B6;&#x4E2D;&#x89E3;&#x653E;&#x51FA;&#x6765;&#x3002;</p>
<h5 id="mobx-&#x53EF;&#x4EE5;&#x548C;-flux-&#x4E00;&#x8D77;&#x4F7F;&#x7528;&#x5417;"><a name="mobx-&#x53EF;&#x4EE5;&#x548C;-flux-&#x4E00;&#x8D77;&#x4F7F;&#x7528;&#x5417;" class="plugin-anchor" href="#mobx-&#x53EF;&#x4EE5;&#x548C;-flux-&#x4E00;&#x8D77;&#x4F7F;&#x7528;&#x5417;"><i class="fa fa-link" aria-hidden="true"></i></a>MobX &#x53EF;&#x4EE5;&#x548C; Flux &#x4E00;&#x8D77;&#x4F7F;&#x7528;&#x5417;?</h5>
<p>&#x5047;&#x8BBE; store &#x4E2D;&#x7684;&#x6570;&#x636E;&#x662F;&#x4E0D;&#x53EF;&#x53D8;&#x7684;&#xFF0C;&#x8FD9;&#x5F88;&#x9002;&#x5408;&#x4F7F;&#x7528; MobX&#xFF0C;&#x800C; Flux &#x7684;&#x5B9E;&#x73B0;&#x5E76;&#x4E0D;&#x80FD;&#x5F88;&#x597D;&#x7684;&#x5DE5;&#x4F5C;&#x3002;
&#x7136;&#x800C;&#xFF0C;&#x4F7F;&#x7528; MobX &#x65F6;&#xFF0C;&#x51CF;&#x5C11;&#x4E86;&#x5BF9; Flux &#x7684;&#x9700;&#x6C42;&#x3002;
MobX &#x5DF2;&#x7ECF;&#x4F18;&#x5316;&#x4E86;&#x6E32;&#x67D3;&#xFF0C;&#x5B83;&#x9002;&#x7528;&#x4E8E;&#x5927;&#x591A;&#x6570;&#x7C7B;&#x578B;&#x7684;&#x6570;&#x636E;&#xFF0C;&#x5305;&#x62EC;&#x5FAA;&#x73AF;&#x548C;&#x7C7B;&#x3002;
&#x56E0;&#x6B64;&#xFF0C;&#x5176;&#x4ED6;&#x7F16;&#x7A0B;&#x8303;&#x4F8B;(&#x5982;&#x7ECF;&#x5178;MVC)&#x73B0;&#x5728;&#x4E5F;&#x53EF;&#x4EE5;&#x8F7B;&#x677E;&#x5E94;&#x7528;&#x4E8E;&#x4F7F;&#x7528; ReactJS + MobX &#x7684;&#x5E94;&#x7528;&#x4E4B;&#x4E2D;&#x3002;</p>
<h5 id="mobx-&#x53EF;&#x4EE5;&#x548C;&#x5176;&#x5B83;&#x6846;&#x67B6;&#x4E00;&#x8D77;&#x4F7F;&#x7528;&#x5417;"><a name="mobx-&#x53EF;&#x4EE5;&#x548C;&#x5176;&#x5B83;&#x6846;&#x67B6;&#x4E00;&#x8D77;&#x4F7F;&#x7528;&#x5417;" class="plugin-anchor" href="#mobx-&#x53EF;&#x4EE5;&#x548C;&#x5176;&#x5B83;&#x6846;&#x67B6;&#x4E00;&#x8D77;&#x4F7F;&#x7528;&#x5417;"><i class="fa fa-link" aria-hidden="true"></i></a>MobX &#x53EF;&#x4EE5;&#x548C;&#x5176;&#x5B83;&#x6846;&#x67B6;&#x4E00;&#x8D77;&#x4F7F;&#x7528;&#x5417;?</h5>
<p>&#x6216;&#x8BB8;&#x5427;&#x3002;
MobX &#x662F;&#x6846;&#x67B6;&#x65E0;&#x5173;&#x7684;&#xFF0C;&#x53EF;&#x4EE5;&#x5E94;&#x7528;&#x5728;&#x4EFB;&#x4F55;&#x73B0;&#x4EE3;JS&#x73AF;&#x5883;&#x4E2D;&#x3002;
&#x4E3A;&#x4E86;&#x65B9;&#x4FBF;&#x8D77;&#x89C1;&#xFF0C;&#x5B83;&#x53EA;&#x662F;&#x7528;&#x4E00;&#x4E2A;&#x5C0F;&#x51FD;&#x6570;&#x6765;&#x5C06; ReactJS &#x7EC4;&#x4EF6;&#x8F6C;&#x6362;&#x4E3A;&#x54CD;&#x5E94;&#x5F0F;&#x89C6;&#x56FE;&#x51FD;&#x6570;&#x3002;
MobX &#x540C;&#x6837;&#x53EF;&#x4EE5;&#x5728;&#x670D;&#x52A1;&#x5668;&#x7AEF;&#x4F7F;&#x7528;&#xFF0C;&#x5E76;&#x4E14;&#x5B83;&#x5DF2;&#x7ECF;&#x53EF;&#x4EE5;&#x548C; jQuery (&#x53C2;&#x89C1;&#x6B64; <a href="http://jsfiddle.net/mweststrate/vxn7qgdw" target="_blank">Fiddle</a>) &#x548C; <a href="https://gist.github.com/mattmccray/d8740ea97013c7505a9b" target="_blank">Deku</a> &#x4E00;&#x8D77;&#x4F7F;&#x7528;&#x4E86;&#x3002;</p>
<h5 id="&#x53EF;&#x4EE5;&#x8BB0;&#x5F55;&#x72B6;&#x6001;&#x5E76;&#x5BF9;&#x5176;&#x8FDB;&#x884C;&#x8865;&#x5145;&#x5417;"><a name="&#x53EF;&#x4EE5;&#x8BB0;&#x5F55;&#x72B6;&#x6001;&#x5E76;&#x5BF9;&#x5176;&#x8FDB;&#x884C;&#x8865;&#x5145;&#x5417;" class="plugin-anchor" href="#&#x53EF;&#x4EE5;&#x8BB0;&#x5F55;&#x72B6;&#x6001;&#x5E76;&#x5BF9;&#x5176;&#x8FDB;&#x884C;&#x8865;&#x5145;&#x5417;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x53EF;&#x4EE5;&#x8BB0;&#x5F55;&#x72B6;&#x6001;&#x5E76;&#x5BF9;&#x5176;&#x8FDB;&#x884C;&#x8865;&#x5145;&#x5417;?</h5>
<p>&#x53EF;&#x4EE5;&#x7684;, &#x53C2;&#x89C1; <a href="http://mobxjs.github.io/mobx/refguide/create-transformer.html" target="_blank">createTransformer</a> &#x4EE5;&#x67E5;&#x770B;&#x4E00;&#x4E9B;&#x793A;&#x4F8B;&#x3002;</p>
<h5 id="&#x53EF;&#x4EE5;&#x544A;&#x8BC9;&#x6211;-mobx-&#x662F;&#x5982;&#x4F55;&#x5DE5;&#x4F5C;&#x7684;&#x5417;"><a name="&#x53EF;&#x4EE5;&#x544A;&#x8BC9;&#x6211;-mobx-&#x662F;&#x5982;&#x4F55;&#x5DE5;&#x4F5C;&#x7684;&#x5417;" class="plugin-anchor" href="#&#x53EF;&#x4EE5;&#x544A;&#x8BC9;&#x6211;-mobx-&#x662F;&#x5982;&#x4F55;&#x5DE5;&#x4F5C;&#x7684;&#x5417;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x53EF;&#x4EE5;&#x544A;&#x8BC9;&#x6211; MobX &#x662F;&#x5982;&#x4F55;&#x5DE5;&#x4F5C;&#x7684;&#x5417;?</h5>
<p>&#x5F53;&#x7136;&#x53EF;&#x4EE5;&#xFF0C;&#x52A0;&#x5165; reactiflux &#x9891;&#x9053;&#x6216;&#x7B7E;&#x51FA;&#x4EE3;&#x7801;&#x3002;&#x6216;&#x8005;&#xFF0C;&#x63D0;&#x4EA4;&#x4E00;&#x4E2A; issue&#xFF0C;&#x4EE5;&#x6FC0;&#x52B1;&#x6211;&#x505A;&#x4E00;&#x4E9B;&#x66F4;&#x597D;&#x7684;&#x89C4;&#x5212; :)&#x3002;
&#x8FD8;&#x53EF;&#x4EE5;&#x53C2;&#x89C1;&#x8FD9;&#x7BC7; <a href="https://medium.com/@mweststrate/becoming-fully-reactive-an-in-depth-explanation-of-mobservable-55995262a254" target="_blank">Medium &#x6587;&#x7AE0;</a>&#x3002;</p>
<h5 id="&#x6211;&#x53EF;&#x4EE5;&#x5728;&#x54EA;&#x627E;&#x5230;&#x66F4;&#x591A;&#x7684;-mobx-&#x8D44;&#x6E90;"><a name="&#x6211;&#x53EF;&#x4EE5;&#x5728;&#x54EA;&#x627E;&#x5230;&#x66F4;&#x591A;&#x7684;-mobx-&#x8D44;&#x6E90;" class="plugin-anchor" href="#&#x6211;&#x53EF;&#x4EE5;&#x5728;&#x54EA;&#x627E;&#x5230;&#x66F4;&#x591A;&#x7684;-mobx-&#x8D44;&#x6E90;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x6211;&#x53EF;&#x4EE5;&#x5728;&#x54EA;&#x627E;&#x5230;&#x66F4;&#x591A;&#x7684; MobX &#x8D44;&#x6E90;?</h5>
<p>&#x6211;&#x4EEC;&#x5DF2;&#x7ECF;&#x5728; <a href="https://github.com/mobxjs/awesome-mobx#awesome-mobx" target="_blank">&#x5B98;&#x65B9;&#x7684; awesome mobx</a> &#x4E2D;&#x7F16;&#x8F91;&#x4E86;&#x5927;&#x91CF;&#x5404;&#x79CD;&#x7C7B;&#x578B;&#x7684;&#x6709;&#x5E2E;&#x52A9;&#x7684;&#x8D44;&#x6E90;&#x5217;&#x8868;&#x3002;&#x5982;&#x679C;&#x4F60;&#x89C9;&#x5F97;&#x5B83;&#x7F3A;&#x5C11;&#x67D0;&#x4E9B;&#x8D44;&#x6E90;&#x7684;&#x8BDD;&#xFF0C;&#x8BF7;&#x5F00;&#x542F; <a href="https://github.com/mobxjs/awesome-mobx/issues/new" target="_blank">issue</a> &#x6216; <a href="https://github.com/mobxjs/awesome-mobx/compare" target="_blank">pull request</a> &#x6765;&#x63CF;&#x8FF0;&#x4F60;&#x60F3;&#x8981;&#x5BFB;&#x627E;&#x6216;&#x5206;&#x4EAB;&#x60A8;&#x6240;&#x6DFB;&#x52A0;&#x7684;&#x94FE;&#x63A5; :) &#x3002;</p>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                
                <a href="../best/pitfalls.html" class="navigation navigation-next navigation-unique" aria-label="Next page: 8.2. 常见陷阱与最佳实践">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"8.1. 常见问题解答","level":"1.8.1","depth":2,"next":{"title":"8.2. 常见陷阱与最佳实践","level":"1.8.2","depth":2,"path":"best/pitfalls.md","ref":"best/pitfalls.md","articles":[]},"previous":{"title":"8. 贴士与技巧","level":"1.8","depth":1,"ref":"","articles":[{"title":"8.1. 常见问题解答","level":"1.8.1","depth":2,"path":"faq/faq.md","ref":"faq/faq.md","articles":[]},{"title":"8.2. 常见陷阱与最佳实践","level":"1.8.2","depth":2,"path":"best/pitfalls.md","ref":"best/pitfalls.md","articles":[]},{"title":"8.3. 如何(不)使用装饰器","level":"1.8.3","depth":2,"path":"best/decorators.md","ref":"best/decorators.md","articles":[]},{"title":"8.4. 使用 trace 进行调试","level":"1.8.4","depth":2,"path":"best/trace.md","ref":"best/trace.md","articles":[]},{"title":"8.5. 定义数据存储","level":"1.8.5","depth":2,"path":"best/store.md","ref":"best/store.md","articles":[]},{"title":"8.6. 优化 React 组件","level":"1.8.6","depth":2,"path":"best/react-performance.md","ref":"best/react-performance.md","articles":[]},{"title":"8.7. 开发工具","level":"1.8.7","depth":2,"path":"best/devtools.md","ref":"best/devtools.md","articles":[]},{"title":"8.8. spy","level":"1.8.8","depth":2,"path":"refguide/spy.md","ref":"refguide/spy.md","articles":[]}]},"dir":"ltr"},"config":{"plugins":["github","edit-link","anchors","copy-code-button","github-buttons"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"github":{"url":"https://github.com/SangKa/mobx-docs-cn"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"github-buttons":{"buttons":[{"user":"SangKa","repo":"MobX-Docs-CN","type":"star","size":"small","count":true},{"user":"SangKa","repo":"MobX-Docs-CN","type":"fork","size":"small","count":true}]},"copy-code-button":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"edit-link":{"label":"完善文档","base":"https://github.com/SangKa/mobx-docs-cn/tree/master/docs"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"anchors":{}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"MobX 中文文档","gitbook":"3.2.2"},"file":{"path":"faq/faq.md","mtime":"2017-07-01T09:30:32.000Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2018-09-18T13:06:52.064Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-github/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-edit-link/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-copy-code-button/toggle.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-github-buttons/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

